#ifndef __LOG_H__
#define __LOG_H__

#include <stdio.h>
//#include "ToolUtil.h"
#include "global_config.h"

//Don't use c++   cout<<

#ifndef TAG
#define TAG "default"
#endif

#define LOG_TO_CURRENT   1// 0=log to syslog ,1=current sonsole

#if LOG_TO_CURRENT

#define LOGV(format,...) {if(log_level<=VERBOSE)printf( "V/" format "\n", ## __VA_ARGS__ );}
#define LOGI(format,...) printf( "I/ [" TAG "] " format "\n", ## __VA_ARGS__ )
#define LOGD(format,...) printf( "D/ [" TAG "] " format "\n", ## __VA_ARGS__ )
#define LOGW(format,...) printf( "W/ [" TAG "] " format "\n", ## __VA_ARGS__ )
#define LOGE(format,...) printf( "E/ [" TAG "] " format "\n", ## __VA_ARGS__ )

#else

#define LOGV   TLOGV
#define LOGI   TLOGI
#define LOGD   TLOGD
#define LOGW   TLOGW
#define LOGE   TLOGE

#endif


#define VERBOSE   	2
#define DEBUG    	3
#define INFO     	4
#define WARN     	5
#define ERROR   	6
#define ASSERT   	7


extern int log_level;
extern int log_to_syslog;// 1=syslog ,0=current sonsole
/*
#define LOGV(format,...) {if(log_level<=VERBOSE){TLOGV(format,##__VA_ARGS__ );  printf("V/"format"\n", ## __VA_ARGS__ );}}
#define LOGD(format,...) {if(log_to_logread){TLOGD(format,##__VA_ARGS__ );}else{printf("D/"format"\n", ## __VA_ARGS__ );}}
#define LOGI(format,...) {if(log_to_logread){TLOGI(format,##__VA_ARGS__ );}else{printf("I/"format"\n", ## __VA_ARGS__ );}}
#define LOGW(format,...) {if(log_to_logread){TLOGW(format,##__VA_ARGS__ );}else{printf("W/"format"\n", ## __VA_ARGS__ );}}
#define LOGE(format,...) {if(log_to_logread){TLOGE(format,##__VA_ARGS__ );}else{printf("E/"format"\n", ## __VA_ARGS__ );}}
*/
#endif	/*__LOG_H__*/



